﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GDI_应用案例.Pages._3D图像
{
    class Face : IFace
    {
        public Bitmap Texture;

        public Point3D[] Points { get; set; }
        public Point3D Normal { get; set; }
        public Bitmap[] Textures { get; set; }

        private int _curIndex = 0;
        Bitmap IFace.Texture
        {
            get
            {
                var bit = Textures[_curIndex++];
                if (_curIndex >= Textures.Length)
                    _curIndex = 0;
                return bit;
            }
        }
    }
    interface IFace
    {
        /// <summary>
        /// 顶点
        /// </summary>
        Point3D[] Points { get; set; }
        /// <summary>
        /// 法向量
        /// </summary>
        Point3D Normal { get; set; }
        Bitmap[] Textures {  get; set; }
        Bitmap Texture { get; }
    }
}
